Developer Documentation
PATHJava Developer Documentation > Mac OS Runtime for Java > MRJToolkit > Programming With MRJToolkit


Methods


MRJOSType

Converts a string, value, or byte array to a value of type MRJOSType .

public MRJOSType(String fromString); public MRJOSType(int fromInt); public MRJOSType(byte fromBytes[]);
fromString
The string to convert to type MRJOSType . This string must be four characters in length. Since each character is represented by 2 bytes in the Unicode standard, this method uses only the low-order byte of each character in fromString .
fromInt
The integer value to convert to type MRJOSType .
fromBytes
The array of bytes to convert to type MRJOSType . The array must contain 4 bytes.

DISCUSSION

This overloaded method defines a wrapper object that acts as the equivalent of a Mac OS 4-byte character constant (such as a creator, file type, or special folder name). When specifying a Mac OS creator, file type, or special folder name in the Java environment, you must refer to it using an MRJ OS type.

SEE ALSO

The "Finder Interface" chapter in Inside Macintosh: Macintosh Toolbox Essentials for information about file types, creators, and folder names.


equals

Compares a value to one of type MRJOSType or an integer.

public final boolean equals (MRJOSType type); public final boolean equals (int type);
type
The value to compare against.
method result
True if the value matches what you compared it against, false otherwise.

DISCUSSION

For example, if you received an MRJ OS type in the variable myType , then

myType.equals(new MRJOSType ("TEXT")) ;

is true if the MRJ OS type is of type 'TEXT' .


toInt

Converts a value of type MRJOSType to an integer.

public int toInt();
method result
The converted integer value.

DISCUSSION

myVal.toInt() is the value myVal converted to an integer.

toString

Converts a value of type MRJOSType to a string.

public String toString();
method result
The converted string.

DISCUSSION

myVal.toString() is the value myVal converted to a string.

© 1998 Apple Computer, Inc. — (Last Updated 10 Dec 98)